package com.code.p9.代理模式.JDK的动态代理;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * 描述: describe
 *
 * @author CodeYang_Site
 * @version 2021/6/7 1:24
 */
public class SubjectHandelProxy implements InvocationHandler {

    private ISubjectOA obj  = null;

    public SubjectHandelProxy(ISubjectOA obj) {
        this.obj = obj;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("---------before-------");
        Object invoke = method.invoke(obj, args);
        System.out.println("---------after-------");
        return invoke;

    }
}
